package com.braveman.im.ui.activity;

import android.view.View;

import android.content.Intent;

import com.braveman.im.R;
import com.braveman.im.bean.NotifyDetailBean;
import com.braveman.im.manager.ApiManager;
import com.ht.baselibs.retrofit.NetCallBack;
import com.ht.baselibs.ui.base.BaseActivity;
import com.ht.baselibs.utils.ActivityUtils;
import com.ht.baselibs.utils.UIUtils;

import retrofit2.Call;
import retrofit2.Response;

/**
 * 作者 昊昊.
 * 年份 2017/10/26.
 * 时间 20:23.
 * 项目名称 hhkj.
 */

/**
 * 群主公告详情
 */
public class DetailsNoticeActivity extends BaseActivity {

    private String detailsId;

    @Override
    protected void initTitleBar() {
        mTitleBarView.setTitleText("群主公告").setLeftBtnIcon(R.mipmap.back_black).setOnLeftBtnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                ActivityUtils.finishActivity(DetailsNoticeActivity.this);
            }
        });
    }

    @Override
    protected boolean isStaticPage() {
        return true;
    }

    @Override
    protected int initContentView() {
        return R.layout.activity_details_notice;
    }

    @Override
    protected void initIntentData(Intent callIntent) {
        detailsId = callIntent.getStringExtra("detailsId");
    }

    @Override
    protected void initChildView() {

    }


    @Override
    protected void initChildData() {
        showLoadingDialog();
        ApiManager.getApi().getGroupNotifyDetails(detailsId).enqueue(new NetCallBack<NotifyDetailBean>() {
            @Override
            protected void onSuccess(Call<NotifyDetailBean> call, Response<NotifyDetailBean> response) {
                UIUtils.showToast("请求成功");
            }

            @Override
            protected void hiddenProgress() {
                hideLodingDialog();
            }

            @Override
            public void onFailure(Call<NotifyDetailBean> call, Throwable t) {
                UIUtils.showToast("处理失败");
            }
        });

    }

    @Override
    protected void setChildViewListener() {

    }
}
